import { Dayjs } from 'dayjs';

export interface SearchInfo {
	datingType?: string;
	datingTheme?: string;
	startTime?: Dayjs | string;
	content?: string;
	imageIds?: string;
	location?: number;
	payMoney?: number;
	startTimeFrom?: Dayjs | string;
	startTimeTo?: Dayjs | string;
	noTopFlagSort?: Boolean | null;
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{
		title: '约会主题',
		dataIndex: 'datingTheme',
		key: 'datingTheme',
		width: '120px',
	},
	{
		title: '约会类型',
		dataIndex: 'datingTypeName',
		key: 'datingType',
	},
	{
		title: '约会开始时间',
		dataIndex: 'startTime',
		key: 'startTime',
	},
	{
		title: '约会结束时间',
		dataIndex: 'endTime',
		key: 'endTime',
	},
	{
		title: '约会地点',
		dataIndex: 'districtName',
		key: 'districtName',
	},
	{
		title: '约会内容',
		dataIndex: 'content',
		key: 'content',
	},
	{
		title: '报名金额',
		dataIndex: 'payMoney',
		key: 'payMoney',
	},
	{
		title: '报名人数',
		dataIndex: 'registrationCount',
		width: '90px',
		key: 'registrationCount',
	},
	{
		title: '创建人编码',
		dataIndex: 'code',
		width: '110px',
		key: 'code',
	},
	{
		title: '是否置顶',
		dataIndex: 'topFlag',
		key: 'topFlag',
	},
	{
		title: '操作',
		key: 'operation',
		fixed: 'right',
		width: '180px',
	},
]);

export interface DataItem {
	datingType: string;
	startTime?: Dayjs | string;
	content: string;
	imageIds: string;
	location: number;
	payMoney: number;
}

export interface ModelInfo {
	title?: string;
	width?: string;
	id?: number | undefined;
	confirmLoading?: boolean;
}

export interface dictInfo {
	typeCode?: string | number | undefined;
	typeName?: string | undefined;
}
